﻿# CMakeList.txt: 顶层 CMake 项目文件，在此处执行全局配置
# 并包含子项目。
#
cmake_minimum_required (VERSION 3.8)

project("testlua")
SET(EXE_NAME "testlua")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BIN_PATH})

include_directories(
    "./src"
	${BASE_THRID_ROOT}/lua
	${BASE_THRID_ROOT}/tolua
)

source_group("tools" FILES ${TOOLS_INC_LIST})
source_group("main" FILES main.cpp)


set(THIRD_INCLUDE_DIRS
)


set(THIRD_LIBRARY_DIRS 
)
#message("third lib dir:${THIRD_LIBRARY_DIRS}")

set(THIRD_LINK_LIBRARY
)

#message("third link lib:${THIRD_LINK_LIBRARY}")


option (USE_GTEST "Use Google Test" ON)
if (${USE_GTEST})
    enable_testing()
	include(CTest)
	message(STATUS "use system GTest")
	find_package(GTest MODULE REQUIRED)
	include_directories(${gtest_SOURCE_DIR}/include ${gmock_SOURCE_DIR}/include)
	message("gtest:${gtest_SOURCE_DIR}  --- ${gmock_SOURCE_DIR}")
	include(GoogleTest)
endif()

list(APPEND GLOBAL_LIB lua tolua)

build_project(
	NAME 
		${EXE_NAME} 
	SRCS
		"main.cpp"
		${TOOLS_INC_LIST}
	INC_DIR
		${THIRD_INCLUDE_DIRS}
	LIB_DIR
		${THIRD_LIBRARY_DIRS}
	LINK_LIB
		${THIRD_LINK_LIBRARY}
		GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main
)

